package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.CampusNavigation;
import com.ruoyi.system.mapper.CampusNavigationMapper;
import com.ruoyi.system.service.CampusNavigationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CampusNavigationServiceImpl implements CampusNavigationService {
    @Autowired
    private CampusNavigationMapper navigationMapper;

    @Override
    public List<CampusNavigation> listByCampusId(Long campusId) {
        return navigationMapper.selectByCampusId(campusId);
    }

    @Override
    public CampusNavigation getById(Long id) {
        return navigationMapper.selectById(id);
    }

    @Override
    @Transactional
    public int save(CampusNavigation navigation) {
        return navigationMapper.insert(navigation);
    }

    @Override
    @Transactional
    public int update(CampusNavigation navigation) {
        return navigationMapper.update(navigation);
    }

    @Override
    @Transactional
    public int deleteByCampusId(Long id) {
        return navigationMapper.deleteByCampusId(id);
    }
}
